package com.fs.ibox_h.servie.impl;

import com.fs.ibox_h.dao.BoticeDao;
import com.fs.ibox_h.dao.CollectionDao;
import com.fs.ibox_h.pojo.Botice;
import com.fs.ibox_h.servie.BoticeService;
import com.fs.ibox_h.util.BeanFactory;
import com.fs.ibox_h.vo.Page;

/**
 * Author:HOU
 * date:2022/11/22  10:26
 * 案例:
 **/
public class BoticeServiceimpl implements BoticeService {
    BoticeDao BoticeDao = BeanFactory.createBean(BoticeDao.class);
    @Override
    public void add(Botice botice) {
        BoticeDao.add(botice);
    }

    @Override
    public Page<Botice> queryAll(int currentPage, int pageSize) {
        Page<Botice> page = new Page<>(currentPage,pageSize);
        page.setCount(BoticeDao.count());
        page.setRecords(BoticeDao.queryAll(currentPage,pageSize));
        return page;
    }

    @Override
    public void delByid(int id) {
        BoticeDao.delByid(id);
    }
}
